<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>butterfly特效篇 | 江畔独步寻花</title><meta name="keywords" content="butterfly,特效"><meta name="author" content="Masterguo"><meta name="copyright" content="Masterguo"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta http-equiv="Cache-Control" content="no-transform"><meta http-equiv="Cache-Control" content="no-siteapp"><meta name="description" content="那些美化我们博客的代码们本篇内容来自于博客搭建爱好者群里的一位大佬，是夜，我们在提要求，大佬在写，基本上三五分钟就是一个特效出炉，叹为观止，">
<meta property="og:type" content="article">
<meta property="og:title" content="butterfly特效篇">
<meta property="og:url" content="https://guodxsmd.github.io/2004124661.html">
<meta property="og:site_name" content="江畔独步寻花">
<meta property="og:description" content="那些美化我们博客的代码们本篇内容来自于博客搭建爱好者群里的一位大佬，是夜，我们在提要求，大佬在写，基本上三五分钟就是一个特效出炉，叹为观止，">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://allengg-1258494402.cos.ap-beijing.myqcloud.com/friendsimg5.jpg">
<meta property="article:published_time" content="2020-12-16T16:40:44.000Z">
<meta property="article:modified_time" content="2020-12-23T17:06:00.336Z">
<meta property="article:author" content="Masterguo">
<meta property="article:tag" content="butterfly">
<meta property="article:tag" content="特效">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://allengg-1258494402.cos.ap-beijing.myqcloud.com/friendsimg5.jpg"><link rel="shortcut icon" href="https://allengg-1258494402.cos.ap-beijing.myqcloud.com/marvelfavicon.png"><link rel="canonical" href="https://guodxsmd.github.io/2004124661"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//fonts.googleapis.com" crossorigin=""/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Titillium+Web&amp;display=swap" media="print" onload="this.media='all'"><script>var GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: {"path":"search.xml","languages":{"hits_empty":"找不到您查询的内容：${query}"}},
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '天',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    jQuery: 'https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js',
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css'
    },
    fancybox: {
      js: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js',
      css: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css'
    }
  },
  isPhotoFigcaption: true,
  islazyload: false,
  isanchor: false
};

var saveToLocal = {
  set: function setWithExpiry(key, value, ttl) {
    const now = new Date()
    const expiryDay = ttl * 86400000
    const item = {
      value: value,
      expiry: now.getTime() + expiryDay,
    }
    localStorage.setItem(key, JSON.stringify(item))
  },

  get: function getWithExpiry(key) {
    const itemStr = localStorage.getItem(key)

    if (!itemStr) {
      return undefined
    }
    const item = JSON.parse(itemStr)
    const now = new Date()

    if (now.getTime() > item.expiry) {
      localStorage.removeItem(key)
      return undefined
    }
    return item.value
  }
}

// https://stackoverflow.com/questions/16839698/jquery-getscript-alternative-in-native-javascript
const getScript = url => new Promise((resolve, reject) => {
  const script = document.createElement('script')
  script.src = url
  script.async = true
  script.onerror = reject
  script.onload = script.onreadystatechange = function() {
    const loadState = this.readyState
    if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
    script.onload = script.onreadystatechange = null
    resolve()
  }
  document.head.appendChild(script)
})</script><script id="config_change">var GLOBAL_CONFIG_SITE = { 
  isPost: true,
  isHome: false,
  isHighlightShrink: true,
  isToc: true,
  postUpdate: '2020-12-24 01:06:00'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(function () {  window.activateDarkMode = function () {
    document.documentElement.setAttribute('data-theme', 'dark')
    if (document.querySelector('meta[name="theme-color"]') !== null) {
      document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
    }
  }
  window.activateLightMode = function () {
    document.documentElement.setAttribute('data-theme', 'light')
   if (document.querySelector('meta[name="theme-color"]') !== null) {
      document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
    }
  }
  const autoChangeMode = 'false'
  const t = saveToLocal.get('theme')
  if (autoChangeMode === '1') {
    const isDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches
    const isLightMode = window.matchMedia('(prefers-color-scheme: light)').matches
    const isNotSpecified = window.matchMedia('(prefers-color-scheme: no-preference)').matches
    const hasNoSupport = !isDarkMode && !isLightMode && !isNotSpecified
    if (t === undefined) {
      if (isLightMode) activateLightMode()
      else if (isDarkMode) activateDarkMode()
      else if (isNotSpecified || hasNoSupport) {
        const now = new Date()
        const hour = now.getHours()
        const isNight = hour <= 6 || hour >= 18
        isNight ? activateDarkMode() : activateLightMode()
      }
      window.matchMedia('(prefers-color-scheme: dark)').addListener(function (e) {
        if (saveToLocal.get('theme') === undefined) {
          e.matches ? activateDarkMode() : activateLightMode()
        }
      })
    } else if (t === 'light') activateLightMode()
    else activateDarkMode()
  } else if (autoChangeMode === '2') {
    const now = new Date()
    const hour = now.getHours()
    const isNight = hour <= 6 || hour >= 18
    if (t === undefined) isNight ? activateDarkMode() : activateLightMode()
    else if (t === 'light') activateLightMode()
    else activateDarkMode()
  } else {
    if (t === 'dark') activateDarkMode()
    else if (t === 'light') activateLightMode()
  }const asideStatus = saveToLocal.get('aside-status')
if (asideStatus !== undefined) {
   if (asideStatus === 'hide') {
     document.documentElement.classList.add('hide-aside')
   } else {
     document.documentElement.classList.remove('hide-aside')
   }
}})()</script><style type="text/css">#toggle-sidebar {bottom: 80px}</style><style>#article-container.post-content h1:before, h2:before, h3:before, h4:before, h5:before, h6:before { -webkit-animation: avatar_turn_around 1s linear infinite; -moz-animation: avatar_turn_around 1s linear infinite; -o-animation: avatar_turn_around 1s linear infinite; -ms-animation: avatar_turn_around 1s linear infinite; animation: avatar_turn_around 1s linear infinite; }</style><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome/css/font-awesome.min.css"><script src="/live2d-widget/autoload.js"></script><script defer src="https://rmt.dogedoge.com/fetch/~/source/jsdelivr/npm/jquery@latest/dist/jquery.min.js"></script><script defer src="https://uuuuu.cf/js/fishes.js"></script><link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/CodeByZach/pace/themes/pink/pace-theme-bounce.css"><link rel="stylesheet" href="/css/title.css"><link rel="stylesheet" href="/css/aplayer.css"><link rel="stylesheet" href="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@10.4.1/build/styles/default.min.css"><script src="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@10.4.1/build/highlight.min.js"></script><meta name="referrer" content="no-referrer-when-downgrade" /><link rel="stylesheet" href="/self/Kimbiedark.css"><meta name="generator" content="Hexo 5.2.0">
<style>.github-emoji { position: relative; display: inline-block; width: 1.2em; min-height: 1.2em; overflow: hidden; vertical-align: top; color: transparent; }  .github-emoji > span { position: relative; z-index: 10; }  .github-emoji img, .github-emoji .fancybox { margin: 0 !important; padding: 0 !important; border: none !important; outline: none !important; text-decoration: none !important; user-select: none !important; cursor: auto !important; }  .github-emoji img { height: 1.2em !important; width: 1.2em !important; position: absolute !important; left: 50% !important; top: 50% !important; transform: translate(-50%, -50%) !important; user-select: none !important; cursor: auto !important; } .github-emoji-fallback { color: inherit; } .github-emoji-fallback img { opacity: 0 !important; }</style>
<link rel="alternate" href="/atom.xml" title="江畔独步寻花" type="application/atom+xml">
</head><body><div id="loading-box"><div class="loading-left-bg"></div><div class="loading-right-bg"></div><div class="spinner-box"><div class="configure-border-1"><div class="configure-core"></div></div><div class="configure-border-2"><div class="configure-core"></div></div><div class="loading-word">加载中...</div></div></div><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="author-avatar"><img class="avatar-img" src="https://allengg-1258494402.cos.ap-beijing.myqcloud.com/banneravatar.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data"><div class="data-item is-center"><div class="data-item-link"><a href="/archives/"><div class="headline">文章</div><div class="length-num">6</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/tags/"><div class="headline">标签</div><div class="length-num">8</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/categories/"><div class="headline">分类</div><div class="length-num">2</div></a></div></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw iconfont icon-Sand-Clock"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/pics/"><i class="fa-fw fas fa-image"></i><span> 图库</span></a></div><div class="menus_item"><a class="site-page" href="/bangumis/"><i class="fa-fw iconfont icon-jiazaishibaitidaiicon"></i><span> 哔哩</span></a></div><div class="menus_item"><a class="site-page" href="/bilibili/"><i class="fa-fw fas fa-video"></i><span> 视频</span></a></div><div class="menus_item"><a class="site-page" href="/artitalk/"><i class="fa-fw fas fa-comment-dots"></i><span> 说说</span></a></div><div class="menus_item"><a class="site-page" href="/bb/"><i class="fa-fw far fa-comment-dots"></i><span> 哔哔</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友人帳</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div></div></div><div id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url(https://allengg-1258494402.cos.ap-beijing.myqcloud.com/friendsimg5.jpg)"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">江畔独步寻花</a></span><span id="weather-v2-plugin-simple"></span><div id="menus"><div id="search-button"><a class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw iconfont icon-Sand-Clock"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/pics/"><i class="fa-fw fas fa-image"></i><span> 图库</span></a></div><div class="menus_item"><a class="site-page" href="/bangumis/"><i class="fa-fw iconfont icon-jiazaishibaitidaiicon"></i><span> 哔哩</span></a></div><div class="menus_item"><a class="site-page" href="/bilibili/"><i class="fa-fw fas fa-video"></i><span> 视频</span></a></div><div class="menus_item"><a class="site-page" href="/artitalk/"><i class="fa-fw fas fa-comment-dots"></i><span> 说说</span></a></div><div class="menus_item"><a class="site-page" href="/bb/"><i class="fa-fw far fa-comment-dots"></i><span> 哔哔</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友人帳</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">butterfly特效篇</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2020-12-16T16:40:44.000Z" title="发表于 2020-12-17 00:40:44">2020-12-17</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2020-12-23T17:06:00.336Z" title="更新于 2020-12-24 01:06:00">2020-12-24</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/%E7%89%B9%E6%95%88/">特效</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-wordcount"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="post-meta-label">字数总计:</span><span class="word-count">2k</span><span class="post-meta-separator">|</span><i class="far fa-clock fa-fw post-meta-icon"></i><span class="post-meta-label">阅读时长:</span><span>11分钟</span></span><span class="post-meta-separator">|</span><span class="post-meta-pv-cv"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"></span></span><span class="post-meta-separator">|</span><span class="post-meta-commentcount"><i class="far fa-comments fa-fw post-meta-icon"></i><span class="post-meta-label">评论数:</span><a href="/2004124661.html#post-comment"><span id="twikoo-count"></span></a></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h1 id="那些美化我们博客的代码们"><a href="#那些美化我们博客的代码们" class="headerlink" title="那些美化我们博客的代码们"></a>那些美化我们博客的代码们</h1><p>本篇内容来自于博客搭建爱好者群里的一位大佬，是夜，我们在提要求，大佬在写，基本上三五分钟就是一个特效出炉，叹为观止，<a id="more"></a>特此抄录，权作学习笔记了。<br>大佬的网站：<br><a target="_blank" rel="noopener" href="https://uuuuu.cf/" title="随手搭建的测试代码用的博客">https://uuuuu.cf/</a><br><a target="_blank" rel="noopener" href="https://weilining.cf/" title="ln`s blog">https://weilining.cf/</a>  </p>
<h2 id="进度弹球"><a href="#进度弹球" class="headerlink" title="进度弹球"></a>进度弹球</h2><p>主题配置文件<code>_config.butterfly.yml</code> 相应位置修改：  </p>
<figure class="highlight yaml"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><code class="hljs yaml"><span class="hljs-attr">inject:</span><br>  <span class="hljs-attr">head:</span><br>    <span class="hljs-bullet">-</span> <span class="hljs-string">&lt;link</span> <span class="hljs-string">rel="stylesheet"</span> <span class="hljs-string">href="https://cdn.jsdelivr.net/gh/CodeByZach/pace/themes/pink/pace-theme-bounce.css"&gt;</span><br>  <span class="hljs-attr">bottom:</span><br>    <span class="hljs-bullet">-</span> <span class="hljs-string">&lt;script</span> <span class="hljs-string">async</span> <span class="hljs-string">src="https://rmt.dogedoge.com/fetch/~/source/jsdelivr/gh/CodeByZach/pace/pace.min.js"&gt;&lt;/script&gt;</span><br></code></pre></td></tr></tbody></table></figure>

<h2 id="网站标题、副标题亮瞎眼的操作"><a href="#网站标题、副标题亮瞎眼的操作" class="headerlink" title="网站标题、副标题亮瞎眼的操作"></a>网站标题、副标题亮瞎眼的操作</h2><p>如果没有，请创建<code>blog/source/css/title.css</code> 写入以下代码：  </p>
<figure class="highlight css"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><code class="hljs css"><span class="hljs-comment">/* 网站标题、副标题闪光 */</span><br><span class="hljs-selector-id">#page-header</span> <span class="hljs-selector-id">#site-title</span>,<br><span class="hljs-selector-id">#page-header</span> <span class="hljs-selector-id">#site-subtitle</span> {<br>  <span class="hljs-attribute">color</span>: <span class="hljs-built_in">rgb</span>(<span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">255</span>);<br>  <span class="hljs-attribute">text-shadow</span>: <span class="hljs-built_in">rgb</span>(<span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">255</span>) <span class="hljs-number">0px</span> <span class="hljs-number">0px</span> <span class="hljs-number">10px</span>, <span class="hljs-built_in">rgb</span>(<span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">255</span>) <span class="hljs-number">0px</span> <span class="hljs-number">0px</span> <span class="hljs-number">20px</span>,<br>    <span class="hljs-built_in">rgb</span>(<span class="hljs-number">255</span>, <span class="hljs-number">0</span>, <span class="hljs-number">222</span>) <span class="hljs-number">0px</span> <span class="hljs-number">0px</span> <span class="hljs-number">30px</span>, <span class="hljs-built_in">rgb</span>(<span class="hljs-number">255</span>, <span class="hljs-number">0</span>, <span class="hljs-number">222</span>) <span class="hljs-number">0px</span> <span class="hljs-number">0px</span> <span class="hljs-number">40px</span>,<br>    <span class="hljs-built_in">rgb</span>(<span class="hljs-number">255</span>, <span class="hljs-number">0</span>, <span class="hljs-number">222</span>) <span class="hljs-number">0px</span> <span class="hljs-number">0px</span> <span class="hljs-number">70px</span>, <span class="hljs-built_in">rgb</span>(<span class="hljs-number">255</span>, <span class="hljs-number">0</span>, <span class="hljs-number">222</span>) <span class="hljs-number">0px</span> <span class="hljs-number">0px</span> <span class="hljs-number">80px</span>,<br>    <span class="hljs-built_in">rgb</span>(<span class="hljs-number">255</span>, <span class="hljs-number">0</span>, <span class="hljs-number">222</span>) <span class="hljs-number">0px</span> <span class="hljs-number">0px</span> <span class="hljs-number">100px</span>;<br>}<br><span class="hljs-selector-id">#page-header</span> <span class="hljs-selector-id">#site-title</span><span class="hljs-selector-pseudo">:hover</span>,<br><span class="hljs-selector-id">#page-header</span> <span class="hljs-selector-id">#site-subtitle</span><span class="hljs-selector-pseudo">:hover</span> {<br>  <span class="hljs-attribute">color</span>: <span class="hljs-built_in">rgb</span>(<span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">255</span>);<br>  <span class="hljs-attribute">text-shadow</span>: <span class="hljs-built_in">rgb</span>(<span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">255</span>) <span class="hljs-number">0px</span> <span class="hljs-number">0px</span> <span class="hljs-number">10px</span>, <span class="hljs-built_in">rgb</span>(<span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">255</span>) <span class="hljs-number">0px</span> <span class="hljs-number">0px</span> <span class="hljs-number">20px</span>,<br>    <span class="hljs-built_in">rgb</span>(<span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">255</span>) <span class="hljs-number">0px</span> <span class="hljs-number">0px</span> <span class="hljs-number">30px</span>, <span class="hljs-built_in">rgb</span>(<span class="hljs-number">0</span>, <span class="hljs-number">255</span>, <span class="hljs-number">255</span>) <span class="hljs-number">0px</span> <span class="hljs-number">0px</span> <span class="hljs-number">40px</span>,<br>    <span class="hljs-built_in">rgb</span>(<span class="hljs-number">0</span>, <span class="hljs-number">255</span>, <span class="hljs-number">255</span>) <span class="hljs-number">0px</span> <span class="hljs-number">0px</span> <span class="hljs-number">70px</span>, <span class="hljs-built_in">rgb</span>(<span class="hljs-number">0</span>, <span class="hljs-number">255</span>, <span class="hljs-number">255</span>) <span class="hljs-number">0px</span> <span class="hljs-number">0px</span> <span class="hljs-number">80px</span>,<br>    <span class="hljs-built_in">rgb</span>(<span class="hljs-number">0</span>, <span class="hljs-number">255</span>, <span class="hljs-number">255</span>) <span class="hljs-number">0px</span> <span class="hljs-number">0px</span> <span class="hljs-number">100px</span>;<br>}<br></code></pre></td></tr></tbody></table></figure>
<p>主题配置文件<code>_config.butterfly.yml</code> 相应位置修改：  </p>
<figure class="highlight yaml"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs yaml"><span class="hljs-attr">inject:</span><br>  <span class="hljs-attr">head:</span><br>    <span class="hljs-bullet">-</span> <span class="hljs-string">&lt;link</span> <span class="hljs-string">rel="stylesheet"</span> <span class="hljs-string">href="/css/title.css"&gt;</span><br></code></pre></td></tr></tbody></table></figure>

<h2 id="水波荡漾"><a href="#水波荡漾" class="headerlink" title="水波荡漾"></a>水波荡漾</h2><p>如果没有请创建<code>blog/source/js/ripples.js</code> 写入以下代码：  </p>
<figure class="highlight javascript"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><code class="hljs javascript">$(<span class="hljs-built_in">document</span>).ready(<span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params"></span>) </span>{<br>  <span class="hljs-keyword">try</span> {<br>    $(<span class="hljs-string">"#page-header"</span>).ripples({<br>      resolution: <span class="hljs-number">512</span>,<br>      dropRadius: <span class="hljs-number">10</span>, <span class="hljs-comment">//px</span><br>      perturbance: <span class="hljs-number">0.04</span>,<br>    });<br>  } <span class="hljs-keyword">catch</span> (e) {<br>    $(<span class="hljs-string">".error"</span>).show().text(e);<br>  }<br>});<br></code></pre></td></tr></tbody></table></figure>

<ul>
<li>开启<code>pjax</code></li>
</ul>
<figure class="highlight yaml"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><code class="hljs yaml"><span class="hljs-attr">inject:</span><br>  <span class="hljs-attr">head:</span><br>  <span class="hljs-attr">bottom:</span><br>    <span class="hljs-bullet">-</span> <span class="hljs-string">&lt;script</span> <span class="hljs-string">defer</span> <span class="hljs-string">src="https://rmt.dogedoge.com/fetch/~/source/jsdelivr/npm/jquery@latest/dist/jquery.min.js"&gt;&lt;/script&gt;</span><br>    <span class="hljs-bullet">-</span> <span class="hljs-string">&lt;script</span> <span class="hljs-string">defer</span> <span class="hljs-string">data-pjax</span> <span class="hljs-string">src="https://cdn.jsdelivr.net/gh/sirxemic/jquery.ripples/dist/jquery.ripples.js"&gt;&lt;/script&gt;</span><br>    <span class="hljs-bullet">-</span> <span class="hljs-string">&lt;script</span> <span class="hljs-string">defer</span> <span class="hljs-string">data-pjax</span> <span class="hljs-string">src="/js/ripples.js"&gt;&lt;/script&gt;</span><br></code></pre></td></tr></tbody></table></figure>

<ul>
<li>未开启<code>pjax</code></li>
</ul>
<figure class="highlight yaml"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><code class="hljs yaml"><span class="hljs-attr">inject:</span><br>  <span class="hljs-attr">head:</span><br>  <span class="hljs-attr">bottom:</span><br>    <span class="hljs-bullet">-</span> <span class="hljs-string">&lt;script</span> <span class="hljs-string">defer</span> <span class="hljs-string">src="https://rmt.dogedoge.com/fetch/~/source/jsdelivr/npm/jquery@latest/dist/jquery.min.js"&gt;&lt;/script&gt;</span><br>    <span class="hljs-bullet">-</span> <span class="hljs-string">&lt;script</span> <span class="hljs-string">defer</span> <span class="hljs-string">src="https://cdn.jsdelivr.net/gh/sirxemic/jquery.ripples/dist/jquery.ripples.js"&gt;&lt;/script&gt;</span><br>    <span class="hljs-bullet">-</span> <span class="hljs-string">&lt;script</span> <span class="hljs-string">defer</span> <span class="hljs-string">src="/js/ripples.js"&gt;&lt;/script&gt;</span><br></code></pre></td></tr></tbody></table></figure>

<h2 id="鱼塘来了！"><a href="#鱼塘来了！" class="headerlink" title="鱼塘来了！"></a>鱼塘来了！</h2><ul>
<li><code>js</code>代码</li>
</ul>
<p>如果没有请创建<code>blog/source/js/fishes.js</code> 写入以下代码：  </p>
<details>
<summary>代码放在页面上有点长，点开查看吧</summary>
<pre><code>
<figure class="highlight js"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br><span class="line">189</span><br><span class="line">190</span><br><span class="line">191</span><br><span class="line">192</span><br><span class="line">193</span><br><span class="line">194</span><br><span class="line">195</span><br><span class="line">196</span><br><span class="line">197</span><br><span class="line">198</span><br><span class="line">199</span><br><span class="line">200</span><br><span class="line">201</span><br><span class="line">202</span><br><span class="line">203</span><br><span class="line">204</span><br><span class="line">205</span><br><span class="line">206</span><br><span class="line">207</span><br><span class="line">208</span><br><span class="line">209</span><br><span class="line">210</span><br><span class="line">211</span><br><span class="line">212</span><br><span class="line">213</span><br><span class="line">214</span><br><span class="line">215</span><br><span class="line">216</span><br><span class="line">217</span><br><span class="line">218</span><br><span class="line">219</span><br><span class="line">220</span><br><span class="line">221</span><br><span class="line">222</span><br><span class="line">223</span><br><span class="line">224</span><br><span class="line">225</span><br><span class="line">226</span><br><span class="line">227</span><br><span class="line">228</span><br><span class="line">229</span><br><span class="line">230</span><br><span class="line">231</span><br><span class="line">232</span><br><span class="line">233</span><br><span class="line">234</span><br><span class="line">235</span><br><span class="line">236</span><br><span class="line">237</span><br><span class="line">238</span><br><span class="line">239</span><br><span class="line">240</span><br><span class="line">241</span><br><span class="line">242</span><br><span class="line">243</span><br><span class="line">244</span><br><span class="line">245</span><br><span class="line">246</span><br><span class="line">247</span><br><span class="line">248</span><br><span class="line">249</span><br><span class="line">250</span><br><span class="line">251</span><br><span class="line">252</span><br><span class="line">253</span><br><span class="line">254</span><br><span class="line">255</span><br><span class="line">256</span><br><span class="line">257</span><br><span class="line">258</span><br><span class="line">259</span><br><span class="line">260</span><br><span class="line">261</span><br><span class="line">262</span><br><span class="line">263</span><br><span class="line">264</span><br><span class="line">265</span><br><span class="line">266</span><br><span class="line">267</span><br><span class="line">268</span><br><span class="line">269</span><br><span class="line">270</span><br><span class="line">271</span><br><span class="line">272</span><br><span class="line">273</span><br><span class="line">274</span><br><span class="line">275</span><br><span class="line">276</span><br><span class="line">277</span><br><span class="line">278</span><br><span class="line">279</span><br><span class="line">280</span><br><span class="line">281</span><br><span class="line">282</span><br><span class="line">283</span><br><span class="line">284</span><br><span class="line">285</span><br><span class="line">286</span><br><span class="line">287</span><br><span class="line">288</span><br><span class="line">289</span><br><span class="line">290</span><br><span class="line">291</span><br><span class="line">292</span><br><span class="line">293</span><br><span class="line">294</span><br><span class="line">295</span><br><span class="line">296</span><br><span class="line">297</span><br><span class="line">298</span><br><span class="line">299</span><br><span class="line">300</span><br><span class="line">301</span><br><span class="line">302</span><br><span class="line">303</span><br><span class="line">304</span><br><span class="line">305</span><br><span class="line">306</span><br><span class="line">307</span><br><span class="line">308</span><br><span class="line">309</span><br><span class="line">310</span><br><span class="line">311</span><br><span class="line">312</span><br><span class="line">313</span><br><span class="line">314</span><br><span class="line">315</span><br><span class="line">316</span><br><span class="line">317</span><br><span class="line">318</span><br><span class="line">319</span><br><span class="line">320</span><br><span class="line">321</span><br><span class="line">322</span><br><span class="line">323</span><br><span class="line">324</span><br><span class="line">325</span><br><span class="line">326</span><br><span class="line">327</span><br><span class="line">328</span><br><span class="line">329</span><br><span class="line">330</span><br><span class="line">331</span><br><span class="line">332</span><br><span class="line">333</span><br><span class="line">334</span><br><span class="line">335</span><br><span class="line">336</span><br><span class="line">337</span><br><span class="line">338</span><br><span class="line">339</span><br><span class="line">340</span><br><span class="line">341</span><br><span class="line">342</span><br><span class="line">343</span><br><span class="line">344</span><br><span class="line">345</span><br><span class="line">346</span><br><span class="line">347</span><br><span class="line">348</span><br><span class="line">349</span><br><span class="line">350</span><br><span class="line">351</span><br><span class="line">352</span><br><span class="line">353</span><br><span class="line">354</span><br><span class="line">355</span><br><span class="line">356</span><br><span class="line">357</span><br><span class="line">358</span><br><span class="line">359</span><br><span class="line">360</span><br><span class="line">361</span><br><span class="line">362</span><br><span class="line">363</span><br></pre></td><td class="code"><pre><code class="hljs js">fish();<br><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">fish</span>(<span class="hljs-params"></span>) </span>{<br>  <span class="hljs-keyword">return</span> (<br>    $(<span class="hljs-string">"footer"</span>).append(<br>      <span class="hljs-string">'&lt;div class="container" id="jsi-flying-fish-container"&gt;&lt;/div&gt;'</span><br>    ),<br>    $(<span class="hljs-string">".container"</span>).css({<br>      width: <span class="hljs-string">"100%"</span>,<br>      height: <span class="hljs-string">"160px"</span>,<br>      margin: <span class="hljs-number">0</span>,<br>      padding: <span class="hljs-number">0</span>,<br>    }),<br>    $(<span class="hljs-string">"#footer-wrap"</span>).css({<br>      position: <span class="hljs-string">"absolute"</span>,<br>      <span class="hljs-string">"text-align"</span>: <span class="hljs-string">"center"</span>,<br>      top: <span class="hljs-number">0</span>,<br>      right: <span class="hljs-number">0</span>,<br>      left: <span class="hljs-number">0</span>,<br>      bottom: <span class="hljs-number">0</span>,<br>    }),<br>    <span class="hljs-built_in">this</span><br>  );<br>}<br><span class="hljs-keyword">var</span> RENDERER = {<br>  POINT_INTERVAL: <span class="hljs-number">5</span>,<br>  FISH_COUNT: <span class="hljs-number">2</span>,<br>  MAX_INTERVAL_COUNT: <span class="hljs-number">50</span>,<br>  INIT_HEIGHT_RATE: <span class="hljs-number">0.5</span>,<br>  THRESHOLD: <span class="hljs-number">50</span>,<br><br>  init: <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params"></span>) </span>{<br>    <span class="hljs-built_in">this</span>.setParameters();<br>    <span class="hljs-built_in">this</span>.reconstructMethods();<br>    <span class="hljs-built_in">this</span>.setup();<br>    <span class="hljs-built_in">this</span>.bindEvent();<br>    <span class="hljs-built_in">this</span>.render();<br>  },<br>  setParameters: <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params"></span>) </span>{<br>    <span class="hljs-built_in">this</span>.$window = $(<span class="hljs-built_in">window</span>);<br>    <span class="hljs-built_in">this</span>.$container = $(<span class="hljs-string">"#jsi-flying-fish-container"</span>);<br>    <span class="hljs-built_in">this</span>.$canvas = $(<span class="hljs-string">"&lt;canvas /&gt;"</span>);<br>    <span class="hljs-built_in">this</span>.context = <span class="hljs-built_in">this</span>.$canvas<br>      .appendTo(<span class="hljs-built_in">this</span>.$container)<br>      .get(<span class="hljs-number">0</span>)<br>      .getContext(<span class="hljs-string">"2d"</span>);<br>    <span class="hljs-built_in">this</span>.points = [];<br>    <span class="hljs-built_in">this</span>.fishes = [];<br>    <span class="hljs-built_in">this</span>.watchIds = [];<br>  },<br>  createSurfacePoints: <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params"></span>) </span>{<br>    <span class="hljs-keyword">var</span> count = <span class="hljs-built_in">Math</span>.round(<span class="hljs-built_in">this</span>.width / <span class="hljs-built_in">this</span>.POINT_INTERVAL);<br>    <span class="hljs-built_in">this</span>.pointInterval = <span class="hljs-built_in">this</span>.width / (count - <span class="hljs-number">1</span>);<br>    <span class="hljs-built_in">this</span>.points.push(<span class="hljs-keyword">new</span> SURFACE_POINT(<span class="hljs-built_in">this</span>, <span class="hljs-number">0</span>));<br><br>    <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i = <span class="hljs-number">1</span>; i &lt; count; i++) {<br>      <span class="hljs-keyword">var</span> point = <span class="hljs-keyword">new</span> SURFACE_POINT(<span class="hljs-built_in">this</span>, i * <span class="hljs-built_in">this</span>.pointInterval),<br>        previous = <span class="hljs-built_in">this</span>.points[i - <span class="hljs-number">1</span>];<br><br>      point.setPreviousPoint(previous);<br>      previous.setNextPoint(point);<br>      <span class="hljs-built_in">this</span>.points.push(point);<br>    }<br>  },<br>  reconstructMethods: <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params"></span>) </span>{<br>    <span class="hljs-built_in">this</span>.watchWindowSize = <span class="hljs-built_in">this</span>.watchWindowSize.bind(<span class="hljs-built_in">this</span>);<br>    <span class="hljs-built_in">this</span>.jdugeToStopResize = <span class="hljs-built_in">this</span>.jdugeToStopResize.bind(<span class="hljs-built_in">this</span>);<br>    <span class="hljs-built_in">this</span>.startEpicenter = <span class="hljs-built_in">this</span>.startEpicenter.bind(<span class="hljs-built_in">this</span>);<br>    <span class="hljs-built_in">this</span>.moveEpicenter = <span class="hljs-built_in">this</span>.moveEpicenter.bind(<span class="hljs-built_in">this</span>);<br>    <span class="hljs-built_in">this</span>.render = <span class="hljs-built_in">this</span>.render.bind(<span class="hljs-built_in">this</span>);<br>  },<br>  setup: <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params"></span>) </span>{<br>    <span class="hljs-built_in">this</span>.points.length = <span class="hljs-number">0</span>;<br>    <span class="hljs-built_in">this</span>.fishes.length = <span class="hljs-number">0</span>;<br>    <span class="hljs-built_in">this</span>.watchIds.length = <span class="hljs-number">0</span>;<br>    <span class="hljs-built_in">this</span>.intervalCount = <span class="hljs-built_in">this</span>.MAX_INTERVAL_COUNT;<br>    <span class="hljs-built_in">this</span>.width = <span class="hljs-built_in">this</span>.$container.width();<br>    <span class="hljs-built_in">this</span>.height = <span class="hljs-built_in">this</span>.$container.height();<br>    <span class="hljs-built_in">this</span>.fishCount =<br>      (((<span class="hljs-built_in">this</span>.FISH_COUNT * <span class="hljs-built_in">this</span>.width) / <span class="hljs-number">500</span>) * <span class="hljs-built_in">this</span>.height) / <span class="hljs-number">500</span>;<br>    <span class="hljs-built_in">this</span>.$canvas.attr({ <span class="hljs-attr">width</span>: <span class="hljs-built_in">this</span>.width, <span class="hljs-attr">height</span>: <span class="hljs-built_in">this</span>.height });<br><br>    <span class="hljs-built_in">this</span>.skyGradient = <span class="hljs-built_in">this</span>.context.createLinearGradient(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-built_in">this</span>.height);<br>    <span class="hljs-built_in">this</span>.skyGradient.addColorStop(<span class="hljs-number">0</span>, <span class="hljs-string">"hsl(180, 80%, 70%)"</span>);<br>    <span class="hljs-built_in">this</span>.skyGradient.addColorStop(<span class="hljs-number">1</span>, <span class="hljs-string">"hsl(180, 80%, 90%)"</span>);<br><br>    <span class="hljs-built_in">this</span>.seaGradient = <span class="hljs-built_in">this</span>.context.createLinearGradient(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-built_in">this</span>.height);<br>    <span class="hljs-built_in">this</span>.seaGradient.addColorStop(<span class="hljs-number">0</span>, <span class="hljs-string">"hsl(180, 80%, 60%)"</span>);<br>    <span class="hljs-built_in">this</span>.seaGradient.addColorStop(<span class="hljs-number">0.5</span>, <span class="hljs-string">"hsl(180, 80%, 50%)"</span>);<br>    <span class="hljs-built_in">this</span>.seaGradient.addColorStop(<span class="hljs-number">1</span>, <span class="hljs-string">"hsl(210, 80%, 50%)"</span>);<br><br>    <span class="hljs-built_in">this</span>.fishes.push(<span class="hljs-keyword">new</span> FISH(<span class="hljs-built_in">this</span>));<br>    <span class="hljs-built_in">this</span>.createSurfacePoints();<br>  },<br>  watchWindowSize: <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params"></span>) </span>{<br>    <span class="hljs-built_in">this</span>.clearTimer();<br>    <span class="hljs-built_in">this</span>.tmpWidth = <span class="hljs-built_in">this</span>.$window.width();<br>    <span class="hljs-built_in">this</span>.tmpHeight = <span class="hljs-built_in">this</span>.$window.height();<br>    <span class="hljs-built_in">this</span>.watchIds.push(<span class="hljs-built_in">setTimeout</span>(<span class="hljs-built_in">this</span>.jdugeToStopResize, <span class="hljs-built_in">this</span>.WATCH_INTERVAL));<br>  },<br>  clearTimer: <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params"></span>) </span>{<br>    <span class="hljs-keyword">while</span> (<span class="hljs-built_in">this</span>.watchIds.length &gt; <span class="hljs-number">0</span>) {<br>      <span class="hljs-built_in">clearTimeout</span>(<span class="hljs-built_in">this</span>.watchIds.pop());<br>    }<br>  },<br>  jdugeToStopResize: <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params"></span>) </span>{<br>    <span class="hljs-keyword">var</span> width = <span class="hljs-built_in">this</span>.$window.width(),<br>      height = <span class="hljs-built_in">this</span>.$window.height(),<br>      stopped = width == <span class="hljs-built_in">this</span>.tmpWidth &amp;&amp; height == <span class="hljs-built_in">this</span>.tmpHeight;<br><br>    <span class="hljs-built_in">this</span>.tmpWidth = width;<br>    <span class="hljs-built_in">this</span>.tmpHeight = height;<br><br>    <span class="hljs-keyword">if</span> (stopped) {<br>      <span class="hljs-built_in">this</span>.setup();<br>    }<br>  },<br>  bindEvent: <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params"></span>) </span>{<br>    <span class="hljs-built_in">this</span>.$window.on(<span class="hljs-string">"resize"</span>, <span class="hljs-built_in">this</span>.watchWindowSize);<br>    <span class="hljs-built_in">this</span>.$container.on(<span class="hljs-string">"mouseenter"</span>, <span class="hljs-built_in">this</span>.startEpicenter);<br>    <span class="hljs-built_in">this</span>.$container.on(<span class="hljs-string">"mousemove"</span>, <span class="hljs-built_in">this</span>.moveEpicenter);<br>  },<br>  getAxis: <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">event</span>) </span>{<br>    <span class="hljs-keyword">var</span> offset = <span class="hljs-built_in">this</span>.$container.offset();<br><br>    <span class="hljs-keyword">return</span> {<br>      x: event.clientX - offset.left + <span class="hljs-built_in">this</span>.$window.scrollLeft(),<br>      y: event.clientY - offset.top + <span class="hljs-built_in">this</span>.$window.scrollTop(),<br>    };<br>  },<br>  startEpicenter: <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">event</span>) </span>{<br>    <span class="hljs-built_in">this</span>.axis = <span class="hljs-built_in">this</span>.getAxis(event);<br>  },<br>  moveEpicenter: <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">event</span>) </span>{<br>    <span class="hljs-keyword">var</span> axis = <span class="hljs-built_in">this</span>.getAxis(event);<br><br>    <span class="hljs-keyword">if</span> (!<span class="hljs-built_in">this</span>.axis) {<br>      <span class="hljs-built_in">this</span>.axis = axis;<br>    }<br>    <span class="hljs-built_in">this</span>.generateEpicenter(axis.x, axis.y, axis.y - <span class="hljs-built_in">this</span>.axis.y);<br>    <span class="hljs-built_in">this</span>.axis = axis;<br>  },<br>  generateEpicenter: <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">x, y, velocity</span>) </span>{<br>    <span class="hljs-keyword">if</span> (<br>      y &lt; <span class="hljs-built_in">this</span>.height / <span class="hljs-number">2</span> - <span class="hljs-built_in">this</span>.THRESHOLD ||<br>      y &gt; <span class="hljs-built_in">this</span>.height / <span class="hljs-number">2</span> + <span class="hljs-built_in">this</span>.THRESHOLD<br>    ) {<br>      <span class="hljs-keyword">return</span>;<br>    }<br>    <span class="hljs-keyword">var</span> index = <span class="hljs-built_in">Math</span>.round(x / <span class="hljs-built_in">this</span>.pointInterval);<br><br>    <span class="hljs-keyword">if</span> (index &lt; <span class="hljs-number">0</span> || index &gt;= <span class="hljs-built_in">this</span>.points.length) {<br>      <span class="hljs-keyword">return</span>;<br>    }<br>    <span class="hljs-built_in">this</span>.points[index].interfere(y, velocity);<br>  },<br>  controlStatus: <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params"></span>) </span>{<br>    <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i = <span class="hljs-number">0</span>, count = <span class="hljs-built_in">this</span>.points.length; i &lt; count; i++) {<br>      <span class="hljs-built_in">this</span>.points[i].updateSelf();<br>    }<br>    <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i = <span class="hljs-number">0</span>, count = <span class="hljs-built_in">this</span>.points.length; i &lt; count; i++) {<br>      <span class="hljs-built_in">this</span>.points[i].updateNeighbors();<br>    }<br>    <span class="hljs-keyword">if</span> (<span class="hljs-built_in">this</span>.fishes.length &lt; <span class="hljs-built_in">this</span>.fishCount) {<br>      <span class="hljs-keyword">if</span> (--<span class="hljs-built_in">this</span>.intervalCount == <span class="hljs-number">0</span>) {<br>        <span class="hljs-built_in">this</span>.intervalCount = <span class="hljs-built_in">this</span>.MAX_INTERVAL_COUNT;<br>        <span class="hljs-built_in">this</span>.fishes.push(<span class="hljs-keyword">new</span> FISH(<span class="hljs-built_in">this</span>));<br>      }<br>    }<br>  },<br>  render: <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params"></span>) </span>{<br>    requestAnimationFrame(<span class="hljs-built_in">this</span>.render);<br>    <span class="hljs-built_in">this</span>.controlStatus();<br><br>    <span class="hljs-built_in">this</span>.context.fillStyle = <span class="hljs-built_in">this</span>.skyGradient;<br>    <span class="hljs-built_in">this</span>.context.fillRect(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-built_in">this</span>.width, <span class="hljs-built_in">this</span>.height);<br>    <span class="hljs-built_in">this</span>.context.fillStyle = <span class="hljs-built_in">this</span>.seaGradient;<br>    <span class="hljs-built_in">this</span>.context.beginPath();<br>    <span class="hljs-built_in">this</span>.context.moveTo(<span class="hljs-number">0</span>, <span class="hljs-built_in">this</span>.height);<br><br>    <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i = <span class="hljs-number">0</span>, count = <span class="hljs-built_in">this</span>.points.length; i &lt; count; i++) {<br>      <span class="hljs-built_in">this</span>.points[i].render(<span class="hljs-built_in">this</span>.context);<br>    }<br>    <span class="hljs-built_in">this</span>.context.lineTo(<span class="hljs-built_in">this</span>.width, <span class="hljs-built_in">this</span>.height);<br>    <span class="hljs-built_in">this</span>.context.closePath();<br>    <span class="hljs-built_in">this</span>.context.fill();<br><br>    <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i = <span class="hljs-number">0</span>, count = <span class="hljs-built_in">this</span>.fishes.length; i &lt; count; i++) {<br>      <span class="hljs-built_in">this</span>.fishes[i].render(<span class="hljs-built_in">this</span>.context);<br>    }<br>  },<br>};<br><span class="hljs-keyword">var</span> SURFACE_POINT = <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">renderer, x</span>) </span>{<br>  <span class="hljs-built_in">this</span>.renderer = renderer;<br>  <span class="hljs-built_in">this</span>.x = x;<br>  <span class="hljs-built_in">this</span>.init();<br>};<br>SURFACE_POINT.prototype = {<br>  SPRING_CONSTANT: <span class="hljs-number">0.03</span>,<br>  SPRING_FRICTION: <span class="hljs-number">0.9</span>,<br>  WAVE_SPREAD: <span class="hljs-number">0.3</span>,<br>  ACCELARATION_RATE: <span class="hljs-number">0.01</span>,<br><br>  init: <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params"></span>) </span>{<br>    <span class="hljs-built_in">this</span>.initHeight = <span class="hljs-built_in">this</span>.renderer.height * <span class="hljs-built_in">this</span>.renderer.INIT_HEIGHT_RATE;<br>    <span class="hljs-built_in">this</span>.height = <span class="hljs-built_in">this</span>.initHeight;<br>    <span class="hljs-built_in">this</span>.fy = <span class="hljs-number">0</span>;<br>    <span class="hljs-built_in">this</span>.force = { <span class="hljs-attr">previous</span>: <span class="hljs-number">0</span>, <span class="hljs-attr">next</span>: <span class="hljs-number">0</span> };<br>  },<br>  setPreviousPoint: <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">previous</span>) </span>{<br>    <span class="hljs-built_in">this</span>.previous = previous;<br>  },<br>  setNextPoint: <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">next</span>) </span>{<br>    <span class="hljs-built_in">this</span>.next = next;<br>  },<br>  interfere: <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">y, velocity</span>) </span>{<br>    <span class="hljs-built_in">this</span>.fy =<br>      <span class="hljs-built_in">this</span>.renderer.height *<br>      <span class="hljs-built_in">this</span>.ACCELARATION_RATE *<br>      (<span class="hljs-built_in">this</span>.renderer.height - <span class="hljs-built_in">this</span>.height - y &gt;= <span class="hljs-number">0</span> ? -<span class="hljs-number">1</span> : <span class="hljs-number">1</span>) *<br>      <span class="hljs-built_in">Math</span>.abs(velocity);<br>  },<br>  updateSelf: <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params"></span>) </span>{<br>    <span class="hljs-built_in">this</span>.fy += <span class="hljs-built_in">this</span>.SPRING_CONSTANT * (<span class="hljs-built_in">this</span>.initHeight - <span class="hljs-built_in">this</span>.height);<br>    <span class="hljs-built_in">this</span>.fy *= <span class="hljs-built_in">this</span>.SPRING_FRICTION;<br>    <span class="hljs-built_in">this</span>.height += <span class="hljs-built_in">this</span>.fy;<br>  },<br>  updateNeighbors: <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params"></span>) </span>{<br>    <span class="hljs-keyword">if</span> (<span class="hljs-built_in">this</span>.previous) {<br>      <span class="hljs-built_in">this</span>.force.previous =<br>        <span class="hljs-built_in">this</span>.WAVE_SPREAD * (<span class="hljs-built_in">this</span>.height - <span class="hljs-built_in">this</span>.previous.height);<br>    }<br>    <span class="hljs-keyword">if</span> (<span class="hljs-built_in">this</span>.next) {<br>      <span class="hljs-built_in">this</span>.force.next = <span class="hljs-built_in">this</span>.WAVE_SPREAD * (<span class="hljs-built_in">this</span>.height - <span class="hljs-built_in">this</span>.next.height);<br>    }<br>  },<br>  render: <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">context</span>) </span>{<br>    <span class="hljs-keyword">if</span> (<span class="hljs-built_in">this</span>.previous) {<br>      <span class="hljs-built_in">this</span>.previous.height += <span class="hljs-built_in">this</span>.force.previous;<br>      <span class="hljs-built_in">this</span>.previous.fy += <span class="hljs-built_in">this</span>.force.previous;<br>    }<br>    <span class="hljs-keyword">if</span> (<span class="hljs-built_in">this</span>.next) {<br>      <span class="hljs-built_in">this</span>.next.height += <span class="hljs-built_in">this</span>.force.next;<br>      <span class="hljs-built_in">this</span>.next.fy += <span class="hljs-built_in">this</span>.force.next;<br>    }<br>    context.lineTo(<span class="hljs-built_in">this</span>.x, <span class="hljs-built_in">this</span>.renderer.height - <span class="hljs-built_in">this</span>.height);<br>  },<br>};<br><span class="hljs-keyword">var</span> FISH = <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">renderer</span>) </span>{<br>  <span class="hljs-built_in">this</span>.renderer = renderer;<br>  <span class="hljs-built_in">this</span>.init();<br>};<br>FISH.prototype = {<br>  GRAVITY: <span class="hljs-number">0.4</span>,<br><br>  init: <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params"></span>) </span>{<br>    <span class="hljs-built_in">this</span>.direction = <span class="hljs-built_in">Math</span>.random() &lt; <span class="hljs-number">0.5</span>;<br>    <span class="hljs-built_in">this</span>.x = <span class="hljs-built_in">this</span>.direction<br>      ? <span class="hljs-built_in">this</span>.renderer.width + <span class="hljs-built_in">this</span>.renderer.THRESHOLD<br>      : -<span class="hljs-built_in">this</span>.renderer.THRESHOLD;<br>    <span class="hljs-built_in">this</span>.y = <span class="hljs-built_in">this</span>.getRandomValue(<br>      (<span class="hljs-built_in">this</span>.renderer.height * <span class="hljs-number">6</span>) / <span class="hljs-number">10</span>,<br>      (<span class="hljs-built_in">this</span>.renderer.height * <span class="hljs-number">9</span>) / <span class="hljs-number">10</span><br>    );<br>    <span class="hljs-built_in">this</span>.previousY = <span class="hljs-built_in">this</span>.y;<br>    <span class="hljs-built_in">this</span>.vx = <span class="hljs-built_in">this</span>.getRandomValue(<span class="hljs-number">4</span>, <span class="hljs-number">10</span>) * (<span class="hljs-built_in">this</span>.direction ? -<span class="hljs-number">1</span> : <span class="hljs-number">1</span>);<br>    <span class="hljs-built_in">this</span>.vy = <span class="hljs-built_in">this</span>.getRandomValue(-<span class="hljs-number">5</span>, -<span class="hljs-number">2</span>);<br>    <span class="hljs-built_in">this</span>.ay = <span class="hljs-built_in">this</span>.getRandomValue(-<span class="hljs-number">0.2</span>, -<span class="hljs-number">0.05</span>);<br>    <span class="hljs-built_in">this</span>.theta = <span class="hljs-number">0</span>;<br>    <span class="hljs-built_in">this</span>.phi = <span class="hljs-number">0</span>;<br>    <span class="hljs-built_in">this</span>.isOut = <span class="hljs-literal">false</span>;<br>  },<br>  getRandomValue: <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">min, max</span>) </span>{<br>    <span class="hljs-keyword">return</span> min + (max - min) * <span class="hljs-built_in">Math</span>.random();<br>  },<br>  controlStatus: <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">context</span>) </span>{<br>    <span class="hljs-built_in">this</span>.previousY = <span class="hljs-built_in">this</span>.y;<br>    <span class="hljs-built_in">this</span>.x += <span class="hljs-built_in">this</span>.vx;<br>    <span class="hljs-built_in">this</span>.y += <span class="hljs-built_in">this</span>.vy;<br>    <span class="hljs-built_in">this</span>.vy += <span class="hljs-built_in">this</span>.ay;<br><br>    <span class="hljs-keyword">if</span> (<span class="hljs-built_in">this</span>.y &lt; <span class="hljs-built_in">this</span>.renderer.height * <span class="hljs-built_in">this</span>.renderer.INIT_HEIGHT_RATE) {<br>      <span class="hljs-built_in">this</span>.vy += <span class="hljs-built_in">this</span>.GRAVITY;<br>      <span class="hljs-built_in">this</span>.isOut = <span class="hljs-literal">true</span>;<br>    } <span class="hljs-keyword">else</span> {<br>      <span class="hljs-keyword">if</span> (<span class="hljs-built_in">this</span>.isOut) {<br>        <span class="hljs-built_in">this</span>.ay = <span class="hljs-built_in">this</span>.getRandomValue(-<span class="hljs-number">0.2</span>, -<span class="hljs-number">0.05</span>);<br>      }<br>      <span class="hljs-built_in">this</span>.isOut = <span class="hljs-literal">false</span>;<br>    }<br>    <span class="hljs-keyword">if</span> (!<span class="hljs-built_in">this</span>.isOut) {<br>      <span class="hljs-built_in">this</span>.theta += <span class="hljs-built_in">Math</span>.PI / <span class="hljs-number">20</span>;<br>      <span class="hljs-built_in">this</span>.theta %= <span class="hljs-built_in">Math</span>.PI * <span class="hljs-number">2</span>;<br>      <span class="hljs-built_in">this</span>.phi += <span class="hljs-built_in">Math</span>.PI / <span class="hljs-number">30</span>;<br>      <span class="hljs-built_in">this</span>.phi %= <span class="hljs-built_in">Math</span>.PI * <span class="hljs-number">2</span>;<br>    }<br>    <span class="hljs-built_in">this</span>.renderer.generateEpicenter(<br>      <span class="hljs-built_in">this</span>.x + (<span class="hljs-built_in">this</span>.direction ? -<span class="hljs-number">1</span> : <span class="hljs-number">1</span>) * <span class="hljs-built_in">this</span>.renderer.THRESHOLD,<br>      <span class="hljs-built_in">this</span>.y,<br>      <span class="hljs-built_in">this</span>.y - <span class="hljs-built_in">this</span>.previousY<br>    );<br><br>    <span class="hljs-keyword">if</span> (<br>      (<span class="hljs-built_in">this</span>.vx &gt; <span class="hljs-number">0</span> &amp;&amp; <span class="hljs-built_in">this</span>.x &gt; <span class="hljs-built_in">this</span>.renderer.width + <span class="hljs-built_in">this</span>.renderer.THRESHOLD) ||<br>      (<span class="hljs-built_in">this</span>.vx &lt; <span class="hljs-number">0</span> &amp;&amp; <span class="hljs-built_in">this</span>.x &lt; -<span class="hljs-built_in">this</span>.renderer.THRESHOLD)<br>    ) {<br>      <span class="hljs-built_in">this</span>.init();<br>    }<br>  },<br>  render: <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">context</span>) </span>{<br>    context.save();<br>    context.translate(<span class="hljs-built_in">this</span>.x, <span class="hljs-built_in">this</span>.y);<br>    context.rotate(<span class="hljs-built_in">Math</span>.PI + <span class="hljs-built_in">Math</span>.atan2(<span class="hljs-built_in">this</span>.vy, <span class="hljs-built_in">this</span>.vx));<br>    context.scale(<span class="hljs-number">1</span>, <span class="hljs-built_in">this</span>.direction ? <span class="hljs-number">1</span> : -<span class="hljs-number">1</span>);<br><br>    context.fillStyle = <span class="hljs-string">"hsl(180, 30%, 80%)"</span>;<br>    context.beginPath();<br>    context.moveTo(-<span class="hljs-number">30</span>, <span class="hljs-number">0</span>);<br>    context.bezierCurveTo(-<span class="hljs-number">20</span>, <span class="hljs-number">15</span>, <span class="hljs-number">15</span>, <span class="hljs-number">10</span>, <span class="hljs-number">40</span>, <span class="hljs-number">0</span>);<br>    context.bezierCurveTo(<span class="hljs-number">15</span>, -<span class="hljs-number">10</span>, -<span class="hljs-number">20</span>, -<span class="hljs-number">15</span>, -<span class="hljs-number">30</span>, <span class="hljs-number">0</span>);<br>    context.fill();<br><br>    context.save();<br>    context.translate(<span class="hljs-number">40</span>, <span class="hljs-number">0</span>);<br>    context.scale(<span class="hljs-number">0.9</span> + <span class="hljs-number">0.2</span> * <span class="hljs-built_in">Math</span>.sin(<span class="hljs-built_in">this</span>.theta), <span class="hljs-number">1</span>);<br>    context.fillStyle = <span class="hljs-string">"hsl(180, 30%, 80%)"</span>;<br>    context.beginPath();<br>    context.moveTo(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>);<br>    context.quadraticCurveTo(<span class="hljs-number">5</span>, <span class="hljs-number">10</span>, <span class="hljs-number">20</span>, <span class="hljs-number">8</span>);<br>    context.quadraticCurveTo(<span class="hljs-number">12</span>, <span class="hljs-number">5</span>, <span class="hljs-number">10</span>, <span class="hljs-number">0</span>);<br>    context.quadraticCurveTo(<span class="hljs-number">12</span>, -<span class="hljs-number">5</span>, <span class="hljs-number">20</span>, -<span class="hljs-number">8</span>);<br>    context.quadraticCurveTo(<span class="hljs-number">5</span>, -<span class="hljs-number">10</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>);<br>    context.fill();<br>    context.restore();<br><br>    context.save();<br>    context.translate(-<span class="hljs-number">3</span>, <span class="hljs-number">0</span>);<br>    context.rotate(<span class="hljs-built_in">Math</span>.PI / <span class="hljs-number">3</span> + (<span class="hljs-built_in">Math</span>.PI / <span class="hljs-number">10</span>) * <span class="hljs-built_in">Math</span>.sin(<span class="hljs-built_in">this</span>.phi));<br>    context.fillStyle = <span class="hljs-string">"hsl(220, 80%, 40%)"</span>;<br>    context.beginPath();<br>    context.moveTo(-<span class="hljs-number">5</span>, <span class="hljs-number">0</span>);<br>    context.bezierCurveTo(-<span class="hljs-number">10</span>, -<span class="hljs-number">10</span>, -<span class="hljs-number">10</span>, -<span class="hljs-number">30</span>, <span class="hljs-number">0</span>, -<span class="hljs-number">40</span>);<br>    context.bezierCurveTo(<span class="hljs-number">12</span>, -<span class="hljs-number">25</span>, <span class="hljs-number">8</span>, -<span class="hljs-number">10</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>);<br>    context.closePath();<br>    context.fill();<br>    context.restore();<br><br>    context.strokeStyle = <span class="hljs-string">"hsl(220, 80%, 40%)"</span>;<br>    context.beginPath();<br>    context.arc(-<span class="hljs-number">15</span>, -<span class="hljs-number">3</span>, <span class="hljs-number">5</span>, <span class="hljs-number">0</span>, <span class="hljs-built_in">Math</span>.PI * <span class="hljs-number">2</span>, <span class="hljs-literal">false</span>);<br>    context.stroke();<br><br>    context.fillStyle = <span class="hljs-string">"hsl(220, 80%, 40%)"</span>;<br>    context.beginPath();<br>    context.arc(-<span class="hljs-number">15</span>, -<span class="hljs-number">3</span>, <span class="hljs-number">3</span>, <span class="hljs-number">0</span>, <span class="hljs-built_in">Math</span>.PI * <span class="hljs-number">2</span>, <span class="hljs-literal">false</span>);<br>    context.fill();<br>    context.restore();<br><br>    <span class="hljs-built_in">this</span>.controlStatus(context);<br>  },<br>};<br>$(<span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params"></span>) </span>{<br>  RENDERER.init();<br>});<br></code></pre></td></tr></tbody></table></figure>
</code></pre>
</details>

<h3 id="配置"><a href="#配置" class="headerlink" title="配置"></a>配置</h3><ul>
<li>开启<code>pjax</code>  </li>
</ul>
<p>主题配置文件<code>_config.butterfly.yml</code> 相应位置修改：  </p>
<figure class="highlight yaml"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><code class="hljs yaml"><span class="hljs-attr">inject:</span><br>  <span class="hljs-attr">head:</span><br>  <span class="hljs-attr">bottom:</span><br>    <span class="hljs-bullet">-</span> <span class="hljs-string">&lt;script</span> <span class="hljs-string">defer</span> <span class="hljs-string">src="https://rmt.dogedoge.com/fetch/~/source/jsdelivr/npm/jquery@latest/dist/jquery.min.js"&gt;&lt;/script&gt;</span><br>    <span class="hljs-bullet">-</span> <span class="hljs-string">&lt;script</span> <span class="hljs-string">defer</span> <span class="hljs-string">data-pjax</span> <span class="hljs-string">src="/js/fishes.js"&gt;&lt;/script&gt;</span><br></code></pre></td></tr></tbody></table></figure>

<ul>
<li>未开启<code>pjax</code></li>
</ul>
<p>主题配置文件<code>_config.butterfly.yml</code> 相应位置修改：  </p>
<figure class="highlight yaml"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><code class="hljs yaml"><span class="hljs-attr">inject:</span><br>  <span class="hljs-attr">head:</span><br>  <span class="hljs-attr">bottom:</span><br>    <span class="hljs-bullet">-</span> <span class="hljs-string">&lt;script</span> <span class="hljs-string">defer</span> <span class="hljs-string">src="https://rmt.dogedoge.com/fetch/~/source/jsdelivr/npm/jquery@latest/dist/jquery.min.js"&gt;&lt;/script&gt;</span><br>    <span class="hljs-bullet">-</span> <span class="hljs-string">&lt;script</span> <span class="hljs-string">defer</span> <span class="hljs-string">src="/js/fishes.js"&gt;&lt;/script&gt;</span><br></code></pre></td></tr></tbody></table></figure>

<h2 id="黑客帝国特效"><a href="#黑客帝国特效" class="headerlink" title="黑客帝国特效"></a>黑客帝国特效</h2><ul>
<li>官方</li>
</ul>
<p><a target="_blank" rel="noopener" href="https://github.com/stevenjoezhang/canvas-matrix.js">https://github.com/stevenjoezhang/canvas-matrix.js</a>  </p>
<ul>
<li><code>Butterfly</code></li>
</ul>
<p>主题配置文件<code>_config.butterfly.yml</code> 相应位置修改：  </p>
<figure class="highlight yaml"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs yaml"><span class="hljs-attr">inject:</span><br>  <span class="hljs-attr">head:</span><br>  <span class="hljs-attr">bottom:</span><br>    <span class="hljs-bullet">-</span> <span class="hljs-string">&lt;script</span> <span class="hljs-string">defer</span> <span class="hljs-string">src="https://cdn.jsdelivr.net/npm/canvas-matrix.js@0/canvas-matrix.min.js"</span> <span class="hljs-string">size="20"</span> <span class="hljs-string">font="arial"&gt;&lt;/script&gt;</span><br></code></pre></td></tr></tbody></table></figure>

<ul>
<li>其他主题</li>
</ul>
<p>页脚加入<code>js</code>  </p>
<figure class="highlight html"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs html"><span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">defer</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://cdn.jsdelivr.net/npm/canvas-matrix.js@0/canvas-matrix.min.js"</span> <span class="hljs-attr">size</span>=<span class="hljs-string">"20"</span> <span class="hljs-attr">font</span>=<span class="hljs-string">"arial"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span><br></code></pre></td></tr></tbody></table></figure>

<p>再次感谢大佬无私无畏的指导！</p>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="mailto:undefined">Masterguo</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="https://guodxsmd.github.io/2004124661.html">https://guodxsmd.github.io/2004124661.html</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://guodxsmd.github.io" target="_blank">江畔独步寻花</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/butterfly/">butterfly</a><a class="post-meta__tags" href="/tags/%E7%89%B9%E6%95%88/">特效</a></div><div class="post_share"><div class="social-share" data-image="https://allengg-1258494402.cos.ap-beijing.myqcloud.com/friendsimg5.jpg" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js" defer></script></div></div><div class="post-reward"><div class="reward-button"><i class="fas fa-qrcode"></i> 打赏<div class="reward-main"><ul class="reward-all"><li class="reward-item"><a href="https://allengg-1258494402.cos.ap-beijing.myqcloud.com/friendswechat.png" target="_blank"><img class="post-qr-code-img" src="https://allengg-1258494402.cos.ap-beijing.myqcloud.com/friendswechat.png" alt="微信"/></a><div class="post-qr-code-desc">微信</div></li><li class="reward-item"><a href="https://allengg-1258494402.cos.ap-beijing.myqcloud.com/friendsalipay.jpg" target="_blank"><img class="post-qr-code-img" src="https://allengg-1258494402.cos.ap-beijing.myqcloud.com/friendsalipay.jpg" alt="支付宝"/></a><div class="post-qr-code-desc">支付宝</div></li></ul></div></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/4136000161.html"><img class="prev-cover" src="https://allengg-1258494402.cos.ap-beijing.myqcloud.com/friendsimg3.jpg" onerror="onerror=null;src='/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">MarkDown语法学习记录</div></div></a></div><div class="next-post pull-right"><a href="/1143428660.html"><img class="next-cover" src="https://allengg-1258494402.cos.ap-beijing.myqcloud.com/friendsimg13.jpg" onerror="onerror=null;src='/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">butterfly主题增加可互动的看板娘</div></div></a></div></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span> 相关推荐</span></div><div class="relatedPosts-list"><div><a href="/1143428660.html" title="butterfly主题增加可互动的看板娘"><img class="cover" src="https://allengg-1258494402.cos.ap-beijing.myqcloud.com/friendsimg13.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2020-12-16</div><div class="title">butterfly主题增加可互动的看板娘</div></div></a></div><div><a href="/3458208829.html" title="butterfly主题增加视频组"><img class="cover" src="https://allengg-1258494402.cos.ap-beijing.myqcloud.com/friendsimg5.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2020-12-10</div><div class="title">butterfly主题增加视频组</div></div></a></div></div></div><hr/><div id="post-comment"><div class="comment-head"><div class="comment-headline"><i class="fas fa-comments fa-fw"></i><span> 评论</span></div><div id="comment-switch"><span class="first-comment">Twikoo</span><span class="switch-btn"></span><span class="second-comment">Valine</span></div></div><div class="comment-wrap"><div><div id="twikoo-wrap"></div></div><div><div class="vcomment" id="vcomment"></div></div></div></div></div><div class="aside_content" id="aside_content"><div class="card-widget card-info"><div class="card-content"><div class="card-info-avatar is-center"><img class="avatar-img" src="https://allengg-1258494402.cos.ap-beijing.myqcloud.com/banneravatar.jpg" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/><div class="author-info__name">Masterguo</div><div class="author-info__description"></div></div><div class="card-info-data"><div class="card-info-data-item is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">6</div></a></div><div class="card-info-data-item is-center"><a href="/tags/"><div class="headline">标签</div><div class="length-num">8</div></a></div><div class="card-info-data-item is-center"><a href="/categories/"><div class="headline">分类</div><div class="length-num">2</div></a></div></div><a class="button--animated" id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/guodxsmd"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/guodxsmd" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="mailto:ghostsnow8023@gmail.com" target="_blank" title="Email"><i class="fas fa-envelope"></i></a><a class="social-icon" href="https://www.facebook.com/mstguo/" target="_blank" title="Facebook"><i class="fab fa-facebook"></i></a><a class="social-icon" href="https://twitter.com/Masterguoboo" target="_blank" title="Twitter"><i class="fab fa-twitter"></i></a></div></div></div><div class="card-widget card-announcement"><div class="card-content"><div class="item-headline"><i class="fas fa-bullhorn card-announcement-animation"></i><span>公告</span></div><div class="announcement_content">東邊日出西邊雨 '<div id="weather-v2-plugin-standard"></div>'</div></div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="card-content"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#%E9%82%A3%E4%BA%9B%E7%BE%8E%E5%8C%96%E6%88%91%E4%BB%AC%E5%8D%9A%E5%AE%A2%E7%9A%84%E4%BB%A3%E7%A0%81%E4%BB%AC"><span class="toc-text">那些美化我们博客的代码们</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E8%BF%9B%E5%BA%A6%E5%BC%B9%E7%90%83"><span class="toc-text">进度弹球</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%BD%91%E7%AB%99%E6%A0%87%E9%A2%98%E3%80%81%E5%89%AF%E6%A0%87%E9%A2%98%E4%BA%AE%E7%9E%8E%E7%9C%BC%E7%9A%84%E6%93%8D%E4%BD%9C"><span class="toc-text">网站标题、副标题亮瞎眼的操作</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%B0%B4%E6%B3%A2%E8%8D%A1%E6%BC%BE"><span class="toc-text">水波荡漾</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E9%B1%BC%E5%A1%98%E6%9D%A5%E4%BA%86%EF%BC%81"><span class="toc-text">鱼塘来了！</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E9%85%8D%E7%BD%AE"><span class="toc-text">配置</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E9%BB%91%E5%AE%A2%E5%B8%9D%E5%9B%BD%E7%89%B9%E6%95%88"><span class="toc-text">黑客帝国特效</span></a></li></ol></li></ol></div></div></div><div class="card-widget card-recent-post"><div class="card-content"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/4136000161.html" title="MarkDown语法学习记录"><img src="https://allengg-1258494402.cos.ap-beijing.myqcloud.com/friendsimg3.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="MarkDown语法学习记录"/></a><div class="content"><a class="title" href="/4136000161.html" title="MarkDown语法学习记录">MarkDown语法学习记录</a><time datetime="2020-12-28T13:44:15.000Z" title="发表于 2020-12-28 21:44:15">2020-12-28</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2004124661.html" title="butterfly特效篇"><img src="https://allengg-1258494402.cos.ap-beijing.myqcloud.com/friendsimg5.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="butterfly特效篇"/></a><div class="content"><a class="title" href="/2004124661.html" title="butterfly特效篇">butterfly特效篇</a><time datetime="2020-12-16T16:40:44.000Z" title="发表于 2020-12-17 00:40:44">2020-12-17</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/1143428660.html" title="butterfly主题增加可互动的看板娘"><img src="https://allengg-1258494402.cos.ap-beijing.myqcloud.com/friendsimg13.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="butterfly主题增加可互动的看板娘"/></a><div class="content"><a class="title" href="/1143428660.html" title="butterfly主题增加可互动的看板娘">butterfly主题增加可互动的看板娘</a><time datetime="2020-12-16T14:43:07.000Z" title="发表于 2020-12-16 22:43:07">2020-12-16</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2118430318.html" title="更换jsDelivr+github图床记录"><img src="https://allengg-1258494402.cos.ap-beijing.myqcloud.com/friendsimg7.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="更换jsDelivr+github图床记录"/></a><div class="content"><a class="title" href="/2118430318.html" title="更换jsDelivr+github图床记录">更换jsDelivr+github图床记录</a><time datetime="2020-12-12T14:37:01.000Z" title="发表于 2020-12-12 22:37:01">2020-12-12</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/3458208829.html" title="butterfly主题增加视频组"><img src="https://allengg-1258494402.cos.ap-beijing.myqcloud.com/friendsimg5.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="butterfly主题增加视频组"/></a><div class="content"><a class="title" href="/3458208829.html" title="butterfly主题增加视频组">butterfly主题增加视频组</a><time datetime="2020-12-10T01:30:44.000Z" title="发表于 2020-12-10 09:30:44">2020-12-10</time></div></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2021 - 2022 By Masterguo</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text">一点浩然气，千里<a target="_blank" rel="noopener" href="https://allengg.cn/">快哉风</a>!<br>　<img src="https://allengg-1258494402.cos.ap-beijing.myqcloud.com/testicp.png"><a target="_blank" rel="noopener" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=41010502004821">豫公网安备 41010502004821号</a>  <a target="_blank" rel="noopener" href="https://beian.miit.gov.cn">豫ICP备2021000052号</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="chat_btn" type="button" title="rightside.chat_btn"><i class="fas fa-sms"></i></button><a id="to_comment" href="#post-comment" title="直达评论"><i class="fas fa-comments"></i></a><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div id="local-search"><div class="search-dialog"><div class="search-dialog__title" id="local-search-title">本地搜索</div><div id="local-input-panel"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div></div><hr/><div id="local-search-results"></div><span class="search-close-button"><i class="fas fa-times"></i></span></div><div id="search-mask"></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="/js/search/local-search.js"></script><script>var preloader = {
  endLoading: () => {
    document.body.style.overflow = 'auto';
    document.getElementById('loading-box').classList.add("loaded")
  },
  initLoading: () => {
    document.body.style.overflow = '';
    document.getElementById('loading-box').classList.remove("loaded")

  }
}
window.addEventListener('load',()=> {preloader.endLoading()})</script><div class="js-pjax"><script>(()=>{
  const $countDom = document.getElementById('twikoo-count')
  const init = () => {
    twikoo.init({
      envId: 'allengg-2gpanvnra711aa19',
      el: '#twikoo-wrap'
    })
  }

  const getCount = () => {
    twikoo.getCommentsCount({
      envId: 'allengg-2gpanvnra711aa19',
      urls: [window.location.pathname],
      includeReply: false
    }).then(function (res) {
      $countDom.innerText = res[0].count
    }).catch(function (err) {
      console.error(err);
    });
  }

  const loadTwikoo = (bool = false) => {
    if (typeof twikoo === 'object') {
      init()
      bool && $countDom && setTimeout(getCount,0)
    } else {
      getScript('https://cdn.jsdelivr.net/npm/twikoo/dist/twikoo.all.min.js').then(()=> {
        init()
        bool && $countDom && setTimeout(getCount,0)
      })
    }
  }

  if ('Twikoo' === 'Twikoo' || !false) {
    if (false) btf.loadComment(document.getElementById('twikoo-wrap'), loadTwikoo)
    else loadTwikoo(true)
  } else {
    window.loadOtherComment = () => {
      loadTwikoo()
    }
  }
})()</script><script>function loadValine () {
  function initValine () {
    let initData = {
      el: '#vcomment',
      appId: 'QTIUhS2jl04YRMFW5hM3WlCu-MdYXbMMI',
      appKey: 'Db16aQKaknF6yJwsGqoAbrXX',
      placeholder: '伊人风度翩翩处处留香月光山中悠悠亮',
      avatar: 'monsterid',
      meta: 'nick,mail,link'.split(','),
      pageSize: '10',
      lang: 'zh-CN',
      recordIP: false,
      serverURLs: '',
      emojiCDN: '',
      emojiMaps: "",
      enableQQ: false,
      path: window.location.pathname,
    }

    if (false) { 
      initData.requiredFields= (''.split(','))
    }
    
    if (false) {
      const otherData = false
      initData = Object.assign({}, initData, otherData)
    }
    
    const valine = new Valine(initData)
  }

  if (typeof Valine === 'function') initValine() 
  else getScript('https://cdn.jsdelivr.net/npm/valine/dist/Valine.min.js').then(initValine)
}

if ('Twikoo' === 'Valine' || !false) {
  if (false) btf.loadComment(document.querySelector('#vcomment'),loadValine)
  else setTimeout(loadValine, 0)
} else {
  function loadOtherComment () {
    loadValine()
  }
}</script><script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div><div class="aplayer no-destroy" data-id="1544998613" data-server="tencent" data-type="playlist" data-fixed="true" data-mini="true" data-listFolded="false" data-order="random" data-preload="auto" data-theme="#2980b9" data-autoplay="false" muted></div><link rel="stylesheet" href="/css/allengg.css"><script data-pjax src="/js/allen.js"><script defer src="https://rmt.dogedoge.com/fetch/~/source/jsdelivr/npm/jquery@latest/dist/jquery.min.js"></script><script defer data-pjax src="https://cdn.jsdelivr.net/gh/sirxemic/jquery.ripples/dist/jquery.ripples.js"></script><script defer data-pjax src="/js/ripples.js"></script><script src="https://apip.weatherdt.com/simple/static/js/weather-simple-common.js?v=2.0"></script><script defer data-pjax src="/js/weather.js"></script><script async src="https://rmt.dogedoge.com/fetch/~/source/jsdelivr/gh/CodeByZach/pace/pace.min.js"></script><script async src="https://cdn.jsdelivr.net/gh/weilining/jsdelivr/javascript/weather/weather.butterfly@3.4.1.js"></script><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/activate-power-mode.min.js"></script><script>POWERMODE.colorful = true;
POWERMODE.shake = false;
POWERMODE.mobile = false;
document.body.addEventListener('input', POWERMODE);
</script><script id="click-show-text" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/click-show-text.min.js" data-mobile="false" data-text="精准,优雅,精忠报国" data-fontsize="15px" data-random="false" async="async"></script><script src="//code.tidio.co/rtj5vfgt7rywnszwq9npj0wpnmeeuqkt.js" async="async"></script><script>function onTidioChatApiReady() {
  window.tidioChatApi.hide();
  window.tidioChatApi.on("close", function() {
    window.tidioChatApi.hide();
  });
}
if (window.tidioChatApi) {
  window.tidioChatApi.on("ready", onTidioChatApiReady);
} else {
  document.addEventListener("tidioChat-ready", onTidioChatApiReady);
}

var chatBtnFn = () => {
  document.getElementById("chat_btn").addEventListener("click", function(){
    window.tidioChatApi.show();
    window.tidioChatApi.open();
  });
}
chatBtnFn()
</script><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js"></script><script src="https://cdn.jsdelivr.net/gh/metowolf/MetingJS@1.2/dist/Meting.min.js"></script><script src="https://cdn.jsdelivr.net/npm/pjax/pjax.min.js"></script><script>let pjaxSelectors = [
  'title',
  '#config_change',
  '#body-wrap',
  '#rightside-config-hide',
  '#rightside-config-show',
  '.js-pjax'
]

if (false) {
  pjaxSelectors.unshift('meta[property="og:image"]', 'meta[property="og:title"]', 'meta[property="og:url"]')
}

var pjax = new Pjax({
  elements: 'a:not([target="_blank"]):not([href="/bilibili/"]):not([href="/bb/"])',
  selectors: pjaxSelectors,
  cacheBust: false,
  analytics: false,
  scrollRestoration: false
})

document.addEventListener('pjax:complete', function () {
  window.refreshFn()

  document.querySelectorAll('script[data-pjax]').forEach(item => {
    const newScript = document.createElement('script')
    const content = item.text || item.textContent || item.innerHTML || ""
    Array.from(item.attributes).forEach(attr => newScript.setAttribute(attr.name, attr.value))
    newScript.appendChild(document.createTextNode(content))
    item.parentNode.replaceChild(newScript, item)
  })

  GLOBAL_CONFIG.islazyload && window.lazyLoadInstance.update()

  typeof chatBtnFn === 'function' && chatBtnFn()
  typeof panguInit === 'function' && panguInit()

  if (typeof gtag === 'function') {
    gtag('config', '', {'page_path': window.location.pathname});
  }

  typeof loadMeting === 'function' && document.getElementsByClassName('aplayer').length && loadMeting()

  // Analytics
  if (false) {
    MtaH5.pgv()
  }

  // prismjs
  typeof Prism === 'object' && Prism.highlightAll()

  typeof preloader === 'object' && preloader.endLoading()
})


document.addEventListener('pjax:send', function () {
  typeof preloader === 'object' && preloader.initLoading()
  
  if (window.aplayers) {
    for (let i = 0; i < window.aplayers.length; i++) {
      if (!window.aplayers[i].options.fixed) {
        window.aplayers[i].destroy()
      }
    }
  }

  typeof typed === 'object' && typed.destroy()

  //reset readmode
  const $bodyClassList = document.body.classList
  $bodyClassList.contains('read-mode') && $bodyClassList.remove('read-mode')

})</script></div></body></html>